06-Use of Variables and defining input.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

enter_weeks = input("Enter how many weeks pregnant:")
enter_weeks = int(enter_weeks)
weeks_in_a_month = input("How many weeks in a month?:")
weeks_in_a_month = int(weeks_in_a_month)
months_pregnant = enter_weeks / weeks_in_a_month
print("Months Pregnant:", months_pregnant)
                    

Try it yourself